<template>
    <div class="about">
        <!-- <img src="../assets/imgs/me.jpg" /> -->
        <HelloWorld msg="大伟聊前端" />
        <GlobalCom></GlobalCom>
        <!-- <h1>This is an about page ----dawei</h1>

        <el-button @click="addProductToCart({ name: 'dawei' })">保存</el-button>

        <div v-for="item in products.subjects" :key="item.url">
            <span>{{ item.title }}</span> || <span>{{ item.episodes_info }}</span>
        </div> -->
    </div>
</template>
<script>
import { mapState, mapActions } from 'vuex';
import HelloWorld from '@/components/HelloWorld.vue';
import { add } from '@/utils/index.js';
let a = add(1, 2);
export default {
    name: 'About',
    components: {
        HelloWorld
    },
    data() {
        return {
            a: a
        };
    },
    computed: mapState({
        products: (state) => state.carts.all
    }),
    methods: {
        ...mapActions('carts', ['addProductToCart'])
    },
    created() {
        this.$store.dispatch('carts/getAllProducts');
    }
};
</script>
